/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package DataAccessObject;

import EntityObject.tblQuanHeEO;
import EntityObject.tblThanhVienEO;
import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author minh
 */
public class tblQuanHeDAO {
    
    public static boolean QuanHe_CheckExist_Fk_MaTV_Bo(tblQuanHeEO _tblQuanHeEO) throws SQLException{
        try {
            String sql="{call tblQuanHe_CheckExist_Fk_MaTV_Bo(?)}";
            CallableStatement cstmt=Connection.conn().prepareCall(sql);
            cstmt.setInt(1, _tblQuanHeEO.getFk_MaTV_Bo());
            ResultSet rs=cstmt.executeQuery();
            while(rs.next()) {
                System.out.println(rs.getString("return_value"));
                return rs.getBoolean("return_value");
            }
            return false;
        }
        catch (SQLException e) {
            System.out.println(e);
            return false;
        }
        finally{Connection.conn().close();}
    }
}
